package b.a.c;

import a.c.q;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;

import java.util.*;

class a
  implements ContentHandler
{
  private static final Set a = new HashSet();
  private final ContentHandler b;
  private final b_ c;
  private int d;
  private int e;
  
  public a(ContentHandler paramContentHandler)
  {
    this.b = paramContentHandler;
    this.c = new b_();
    this.d = 0;
    this.e = -1;
  }
  
  public ContentHandler a()
  {
    return this.b;
  }
  
  public void endDocument()
    throws SAXException
  {
    this.c.a(-1, "xlink");
    this.c.a(-1, "");
    this.b.endDocument();
  }
  
  public void startDocument()
    throws SAXException
  {
    this.b.startDocument();
    this.c.a(-1, "", "http://www.w3.org/2000/svg");
    this.c.a(-1, "xlink", "http://www.w3.org/1999/xlink");
  }
  
  public void characters(char[] paramArrayOfChar, int paramInt1, int paramInt2)
    throws SAXException
  {
    if ((b.f != 0) || (this.e < 0)) {
      this.b.characters(paramArrayOfChar, paramInt1, paramInt2);
    }
  }
  
  public void ignorableWhitespace(char[] paramArrayOfChar, int paramInt1, int paramInt2)
    throws SAXException
  {
    this.b.ignorableWhitespace(paramArrayOfChar, paramInt1, paramInt2);
  }
  
  public void endPrefixMapping(String paramString)
    throws SAXException
  {
    this.b.endPrefixMapping(paramString);
    this.c.a(this.d, paramString);
  }
  
  public void skippedEntity(String paramString)
    throws SAXException
  {
    this.b.skippedEntity(paramString);
  }
  
  public void setDocumentLocator(Locator paramLocator)
  {
    this.b.setDocumentLocator(paramLocator);
  }
  
  public void processingInstruction(String paramString1, String paramString2)
    throws SAXException
  {
    this.b.processingInstruction(paramString1, paramString2);
  }
  
  public void startPrefixMapping(String paramString1, String paramString2)
    throws SAXException
  {
    this.c.a(this.d, paramString1, paramString2);
    this.b.startPrefixMapping(paramString1, paramString2);
  }
  
  public void endElement(String paramString1, String paramString2, String paramString3)
    throws SAXException
  {
    int j = b.f;
    if (j == 0)
    {
      if (this.e < 0)
      {
        int i = paramString3.indexOf(':');
        String str1;
        String str2;
        if (i > -1)
        {
          str1 = paramString3.substring(0, i);
          str2 = paramString3.substring(i + 1);
          if (j == 0) {}
        }
        else
        {
          str1 = "";
          str2 = paramString3;
        }
        String str3 = this.c.a(str1);
        if ((a.contains(str2)) && (str3 != null)) {
          this.b.endElement(str3, paramString3.substring(i + 1), paramString3);
        }
        Iterator localIterator = this.c.a(this.d);
        do
        {
          if (!localIterator.hasNext()) {
            break;
          }
          c_ localc_ = (c_)localIterator.next();
          this.b.endPrefixMapping(localc_.b);
          localIterator.remove();
          if (j != 0) {
            return;
          }
        } while (j == 0);
      }
      if (j != 0) {}
    }
    else if (this.e == this.d)
    {
      this.e = -1;
    }
    this.d -= 1;
  }
  
  public void startElement(String paramString1, String paramString2, String paramString3, Attributes paramAttributes)
    throws SAXException
  {
    int m = b.f;
    this.d += 1;
    if ((m != 0) || (this.e < 0))
    {
      int i = 0;
      int j = paramAttributes.getLength();
      do
      {
        if (i >= j) {
          break;
        }
        String str3 = paramAttributes.getQName(i);
        if (m == 0)
        {
          if (m != 0) {
            break label134;
          }
          if (str3.startsWith("xmlns"))
          {
            localObject = this.c.a(this.d, str3, paramAttributes.getValue(i));
            this.b.startPrefixMapping(((c_)localObject).b, ((c_)localObject).c);
          }
          i++;
        }
      } while (m == 0);
      label134:
      int k = paramString3.indexOf(':');
      String str1;
      String str2;
      if (k > -1)
      {
        str1 = paramString3.substring(0, k);
        str2 = paramString3.substring(k + 1);
      }
      else
      {
        str1 = "";
        str2 = paramString3;
      }
      Object localObject = this.c.a(str1);
      if ((a.contains(str2)) && (localObject != null))
      {
        this.b.startElement((String)localObject, paramString3.substring(k + 1), paramString3, paramAttributes);
        if (m == 0) {}
      }
      else
      {
        this.e = this.d;
      }
    }
  }
  
  static
  {
    a.add("a");
    a.add("altGlyph");
    a.add("altGlyphDef");
    a.add("altGlyphItem");
    a.add("animate");
    a.add("animateColor");
    a.add("animateMotion");
    a.add("animateTransform");
    a.add("circle");
    a.add("clipPath");
    a.add("color-profile");
    a.add("cursor");
    a.add("definition-src");
    a.add("defs");
    a.add("desc");
    a.add("ellipse");
    a.add("feBlend");
    a.add("feColorMatrix");
    a.add("feComponentTransfer");
    a.add("feComposite");
    a.add("feConvolveMatrix");
    a.add("feDiffuseLighting");
    a.add("feDisplacementMap");
    a.add("feDistantLight");
    a.add("feFlood");
    a.add("feFuncA");
    a.add("feFuncR");
    a.add("feFuncG");
    a.add("feFuncB");
    a.add("feGaussianBlur");
    a.add("feImage");
    a.add("feMerge");
    a.add("feMergeNode");
    a.add("feMorphology");
    a.add("feOffset");
    a.add("fePointLight");
    a.add("feSpecularLighting");
    a.add("feSpotLight");
    a.add("feTile");
    a.add("feTurbulence");
    a.add("filter");
    a.add("font");
    a.add("font-face");
    a.add("font-face-format");
    a.add("font-face-name");
    a.add("font-face-src");
    a.add("font-face-uri");
    a.add("foreignObject");
    a.add("g");
    a.add("glyph");
    a.add("glyphRef");
    a.add("hkern");
    a.add("image");
    a.add("line");
    a.add("linearGradient");
    a.add("marker");
    a.add("mask");
    a.add("metadata");
    a.add("missing-glyph");
    a.add("mpath");
    a.add("path");
    a.add("pattern");
    a.add("polygon");
    a.add("polyline");
    a.add("radialGradient");
    a.add("rect");
    a.add("set");
    a.add("script");
    a.add("stop");
    a.add("style");
    a.add("svg");
    a.add("switch");
    a.add("symbol");
    a.add("text");
    a.add("textPath");
    a.add("title");
    a.add("tref");
    a.add("tspan");
    a.add("use");
    a.add("view");
    a.add("vkern");
    a.add("flowDiv");
    a.add("flowLine");
    a.add("flowPara");
    a.add("flowRegionBreak");
    a.add("flowRegion");
    a.add("flowRegionExclude");
    a.add("flowRoot");
    a.add("flowSpan");
    a.add("multiImage");
    a.add("solidColor");
    a.add("subImage");
    a.add("subImageRef");
  }
  
  private static final class b_
  {
    private final LinkedList a = new LinkedList();
    private final Map b = new HashMap();
    
    String a(String paramString)
    {
      a.c_ localc_ = (a.c_)this.b.get(paramString);
      if ((b.f != 0) || (localc_ != null)) {
        return localc_.c;
      }
      return null;
    }
    
    a.c_ a(int paramInt, String paramString1, String paramString2)
    {
      int j = b.f;
      int i = paramString1.indexOf(':');
      a.c_ localc_;
      if (i > -1)
      {
        localc_ = new a.c_(paramInt, paramString1.substring(i + 1), paramString2, null);
        if (j != 0) {
          q.o = !q.o;
        }
      }
      else
      {
        localc_ = new a.c_(paramInt, "", paramString2, null);
      }
      a.c_.access$102(localc_, (a.c_)this.b.put(localc_.b, localc_));
      return localc_;
    }
    
    void a(int paramInt, String paramString)
    {
      int i = b.f;
      ListIterator localListIterator = this.a.listIterator(this.a.size());
      label124:
      do
      {
        a.c_ localc_;
        do
        {
          do
          {
            do
            {
              do
              {
                if (!localListIterator.hasPrevious()) {
                  break;
                }
                localc_ = (a.c_)localListIterator.previous();
              } while (localc_.a != paramInt);
            } while (i != 0);
          } while (!paramString.equals(localc_.b));
          localListIterator.remove();
          if (i != 0) {
            break label124;
          }
          if (a.c_.access$100(localc_) != null) {
            break;
          }
          this.b.remove(localc_.b);
        } while (i == 0);
        this.b.put(localc_.b, a.c_.access$100(localc_));
      } while (i == 0);
    }
    
    Iterator a(int paramInt)
    {
      return new a_(paramInt);
    }
    
    void b(int paramInt)
    {
      int i = b.f;
      ListIterator localListIterator = this.a.listIterator(this.a.size());
      label101:
      do
      {
        a.c_ localc_;
        do
        {
          do
          {
            if (!localListIterator.hasPrevious()) {
              break;
            }
            localc_ = (a.c_)localListIterator.previous();
          } while (localc_.a != paramInt);
          localListIterator.remove();
          if (i != 0) {
            break label101;
          }
          if (a.c_.access$100(localc_) != null) {
            break;
          }
          this.b.remove(localc_.b);
        } while (i == 0);
        this.b.put(localc_.b, a.c_.access$100(localc_));
      } while (i == 0);
    }
    
    private final class a_
      implements Iterator
    {
      private final ListIterator a = a.b_.this.a.listIterator(a.b_.this.a.size());
      private final int b;
      private a.c_ c;
      private a.c_ d;
      
      a_(int paramInt)
      {
        this.b = paramInt;
        this.c = null;
        this.d = null;
        a();
        if (q.o)
        {
          i++;
          b.f = i;
        }
      }
      
      public boolean hasNext()
      {
        return this.d != null;
      }
      
      public Object next()
        throws NoSuchElementException
      {
        if (b.f == 0)
        {
          if (this.d == null) {
            throw new NoSuchElementException();
          }
          this.c = this.d;
          a();
        }
        return this.c;
      }
      
      public void remove()
      {
        int i = b.f;
        this.a.remove();
        if ((i != 0) || (this.c != null))
        {
          if (i == 0) {
            if (a.c_.access$100(this.c) == null)
            {
              a.b_.this.b.remove(this.c.b);
              if (i == 0) {
                return;
              }
            }
          }
          a.b_.this.b.put(this.c.b, a.c_.access$100(this.c));
          if (i == 0) {}
        }
        else
        {
          throw new IllegalStateException();
        }
      }
      
      private void a()
      {
        int j = b.f;
        this.d = null;
        int i = 1;
        do
        {
          if (!this.a.hasPrevious()) {
            break;
          }
          if (j == 0)
          {
            if (i == 0) {
              break;
            }
            this.d = ((a.c_)this.a.previous());
          }
          if (j == 0) {}
          i = this.d.a != this.b ? 1 : 0;
        } while (j == 0);
      }
    }
  }
  
  private static final class c_
  {
    final int a;
    final String b;
    final String c;
    private c_ d;
    
    private c_(int paramInt, String paramString1, String paramString2)
    {
      this.a = paramInt;
      this.b = paramString1;
      this.c = paramString2;
      this.d = null;
    }
    
    static c_ a(int paramInt, String paramString1, String paramString2)
    {
      int i = paramString1.indexOf(':');
      if (i > -1) {
        return new c_(paramInt, paramString1.substring(paramInt + 1), paramString2);
      }
      return new c_(paramInt, "", paramString2);
    }
    
    c_(int paramInt, String paramString1, String paramString2, a.0 param0)
    {
      this(paramInt, paramString1, paramString2);
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     b.a.c.a

 * JD-Core Version:    0.7.0.1

 */